| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Static Public Member Functions | List of all members
nkGraphics::MeshUtils Class Referencefinal

Offers capabilities to ease the manipulation of meshes in some contexts. More...

## Static Public Member Functions
static PackedMeshData | packIntoMeshData (const nkMemory::BufferView< VertexData > &meshInfo, const VertexComposition &composition)
static void | fillMeshFromDecodedData (DecodedMeshData &data, Mesh *mesh, const MeshFillOptions &options=MeshFillOptions())
static BoundingBox | computeBounds (const nkMemory::BufferView< unsigned char > &vertexBuffer, unsigned int byteStride, const MeshInputLayoutAttribute &positionAttribute, LogManager *logManager)
static AttributeGenerationOutput | computeNormals (const AttributeGenerationInfo &inputInfo, LogManager *logManager)
static void | computeNormals (const AttributeGenerationInfo &inputInfo, AttributeGenerationOutput &outputInfo, LogManager *logManager)
static AttributeGenerationOutput | computeBinormals (const AttributeGenerationInfo &inputInfo, LogManager *logManager)
static void | computeBinormals (const AttributeGenerationInfo &inputInfo, AttributeGenerationOutput &outputInfo, LogManager *logManager)
static AttributeGenerationOutput | computeTangents (const AttributeGenerationInfo &inputInfo, LogManager *logManager)
static void | computeTangents (const AttributeGenerationInfo &inputInfo, AttributeGenerationOutput &outputInfo, LogManager *logManager)

## Detailed Description

Offers capabilities to ease the manipulation of meshes in some contexts.

## Member Function Documentation

## ◆ packIntoMeshData()

static PackedMeshData nkGraphics::MeshUtils::packIntoMeshData | ( | const nkMemory::BufferView< VertexData > & | meshInfo,
|  | const VertexComposition & | composition
| ) |  |
| static

Translates a high-level structure representation of vertices into low-level data a mesh can use.

Parameters

  meshInfo | The vertices the mesh should be composed of.
  composition | Expected composition of output data.

Returns
  Data once tightly packed, ready to be fed to a mesh.

Remarks
  Composition will drive which attributes will be taken from the VertexData structure on input. This will impact resulting buffer and layout.

## ◆ fillMeshFromDecodedData()

static void nkGraphics::MeshUtils::fillMeshFromDecodedData | ( | DecodedMeshData & | data,
|  | Mesh * | mesh,
|  | const MeshFillOptions & | options = `MeshFillOptions()`
| ) |  |
| static

Fills a mesh from a decoded mesh data. This will reset the mesh to be an exact match of provided decoded data.

Parameters

  data | The decoded data to use as input.
  mesh | The mesh to fill using decoded data.
  options | The options altering how the filling operation will occur.

## ◆ computeBounds()

static BoundingBox nkGraphics::MeshUtils::computeBounds | ( | const nkMemory::BufferView< unsigned char > & | vertexBuffer,
|  | unsigned int | byteStride,
|  | const MeshInputLayoutAttribute & | positionAttribute,
|  | LogManager * | logManager
| ) |  |
| static

Computes axis-aligned bounds for a given position buffer.

Parameters

  vertexBuffer | The buffer giving the positions to compute the bounds from.
  byteStride | The stride of the buffer.
  positionAttribute | An attribute describing how to find back the position information from the buffer.
  logManager | Target log manager, if logging is necessary.

Returns
  Resulting axis-aligned bounding box, wrapping the whole point cloud provided.

## ◆ computeNormals() [1/2]

static AttributeGenerationOutput nkGraphics::MeshUtils::computeNormals | ( | const AttributeGenerationInfo & | inputInfo,
|  | LogManager * | logManager
| ) |  |
| static

Compute normals from a given vertex buffer.
This operation requires the position buffer only.

Parameters

  inputInfo | A description of the input data.
  logManager | Target log manager, if logging is necessary.

Returns
  Generation result.

Remarks
  This overload will automatically create the output buffer based on input information provided. Buffer will then be used when outputting the attributes. The structure will hold all information client code requires to interpret the data and provide it to a mesh.

## ◆ computeNormals() [2/2]

static void nkGraphics::MeshUtils::computeNormals | ( | const AttributeGenerationInfo & | inputInfo,
|  | AttributeGenerationOutput & | outputInfo,
|  | LogManager * | logManager
| ) |  |
| static

Compute normals from a given vertex buffer.
This operation requires the position buffer only.

Parameters

  inputInfo | A description of the input data.
  outputInfo | The output info to work from, and generate data into.
  logManager | Target log manager, if logging is necessary.

Remarks
  This overload will use the outputInfo provided. It allows to make it generate data into a preallocated buffer with custom offset and stride. The format for normals will be R32G32B32_FLOAT.

## ◆ computeBinormals() [1/2]

static AttributeGenerationOutput nkGraphics::MeshUtils::computeBinormals | ( | const AttributeGenerationInfo & | inputInfo,
|  | LogManager * | logManager
| ) |  |
| static

Compute binormals from a given vertex buffer set.
This operation requires the position and texture coordinate buffers.

Parameters

  inputInfo | A description of the input data.
  logManager | Target log manager, if logging is necessary.

Returns
  Generation result.

Remarks
  This overload will automatically create the output buffer based on input information provided. Buffer will then be used when outputting the attributes. The structure will hold all information client code requires to interpret the data and provide it to a mesh.

## ◆ computeBinormals() [2/2]

static void nkGraphics::MeshUtils::computeBinormals | ( | const AttributeGenerationInfo & | inputInfo,
|  | AttributeGenerationOutput & | outputInfo,
|  | LogManager * | logManager
| ) |  |
| static

Compute binormals from a given vertex buffer set.
This operation requires the position and texture coordinate buffers.

Parameters

  inputInfo | A description of the input data.
  outputInfo | The output info to work from, and generate data into.
  logManager | Target log manager, if logging is necessary.

Remarks
  This overload will use the outputInfo provided. It allows to make it generate data into a preallocated buffer with custom offset and stride. The format for binormals will be R32G32B32_FLOAT.

## ◆ computeTangents() [1/2]

static AttributeGenerationOutput nkGraphics::MeshUtils::computeTangents | ( | const AttributeGenerationInfo & | inputInfo,
|  | LogManager * | logManager
| ) |  |
| static

Compute tangents from a given vertex buffer set.
This operation requires the position and texture coordinate buffers.

Parameters

  inputInfo | A description of the input data.
  logManager | Target log manager, if logging is necessary.

Returns
  Generation result.

Remarks
  This overload will automatically create the output buffer based on input information provided. Buffer will then be used when outputting the attributes. The structure will hold all information client code requires to interpret the data and provide it to a mesh.

## ◆ computeTangents() [2/2]

static void nkGraphics::MeshUtils::computeTangents | ( | const AttributeGenerationInfo & | inputInfo,
|  | AttributeGenerationOutput & | outputInfo,
|  | LogManager * | logManager
| ) |  |
| static

Compute tangents from a given vertex buffer set.
This operation requires the position and texture coordinate buffers.

Parameters

  inputInfo | A description of the input data.
  outputInfo | The output info to work from, and generate data into.
  logManager | Target log manager, if logging is necessary.

Remarks
  This overload will use the outputInfo provided. It allows to make it generate data into a preallocated buffer with custom offset and stride. The format for tangents will be R32G32B32_FLOAT.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsGraphics/Meshes/Utils/MeshUtils.h